package com.yangxd.hospital.mapper;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.Constants;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yangxd.hospital.entity.Department;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;

import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Update;

/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 * @author yangxd
 * @since 2021-05-09
 */
public interface DepartmentMapper extends BaseMapper<Department> {
    /**
     * 分页查询
     * @param page
     * @param wrapper
     * @return
     */
    IPage<Department> findPageDepartment(Page<Department> page, @Param(Constants.WRAPPER) QueryWrapper<Department> wrapper);

    /**
     * 删除
     * @param departmentId
     */
    @Update("update department set deleted = 1 where department_id = #{departmentId}")
    void deleteById(Integer departmentId);

}
